<template>
  <div>
    <main>
      <div class="title">AI成绩自动分析结果：</div>
      <div class="item">
        <ul>
          <li v-for="(item, index) in dataList" :key="index">
            <p class="bt">{{ item.name }}</p>
            <p class="info">
              {{ item.cotent }}
            </p>
          </li>
        </ul>
        <div class="makeplan" @click="toStudyPlanInfo">
          <router-link to="" >制定学习计划</router-link>
        </div>
      </div>
    </main>
  </div>
</template>

<script>
import api from '@/config/api'
import { sendPost } from '../../../utils/http'
export default {
  data () {
    return {
      dataList: []
    }
  },
  created () {
    this.dataList = JSON.parse(sessionStorage.getItem('dataList'))
  },
  methods: {
    toStudyPlanInfo () {
      sendPost(api.formulateStudyPlan, {}).then(res => {
        console.log(res);
        this.$router.push('survey')
        sessionStorage.setItem('studyPlan', JSON.stringify(res.data))
      })
    }
  },
}
</script>

<style lang="less" scoped>
main {
  padding: 0 1.25rem;
  padding-bottom: 1.25rem;
  box-sizing: border-box;
  .title {
    height: 5rem;
    border-bottom: 1px solid #ededed;
    font-size: 1.25rem;
    color: #333;
    font-weight: bold;
    line-height: 5rem;
  }
  .item {
    ul {
      li {
        background-color: #fffafa;
        margin-top: 1.25rem;
        padding: 0 1.875rem 1rem 1.25rem;
        box-sizing: border-box;
        border-radius: 1px;
        .bt {
          height: 4.0625rem;
          line-height: 4.0625rem;
          font-size: 1.25rem;
          font-family: Microsoft YaHei;
          font-weight: bold;
          color: #333333;
        }
        .info {
          font-size: 1rem;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #333333;
          line-height: 2rem;
        }
      }
    }
  }
  .makeplan {
    width: 25rem;
    height: 3.75rem;
    line-height: 3.75rem;
    font-size: 1.5rem;
    text-align: center;
    color: #fff;
    background-color: #ff5e4e;
    border: 0.0625rem solid #ff5e4e;
    border-radius: 0.1875rem;
    margin: 3.75rem auto;
    a {
      color: #fff;
    }
  }
}
</style>
